package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ShopOrderItemMapper;
import com.ruoyi.system.domain.ShopOrderItem;
import com.ruoyi.system.service.IShopOrderItemService;

/**
 * 订单项Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class ShopOrderItemServiceImpl implements IShopOrderItemService 
{
    @Autowired
    private ShopOrderItemMapper shopOrderItemMapper;

    /**
     * 查询订单项
     * 
     * @param itemId 订单项主键
     * @return 订单项
     */
    @Override
    public ShopOrderItem selectShopOrderItemByItemId(Long itemId)
    {
        return shopOrderItemMapper.selectShopOrderItemByItemId(itemId);
    }

    /**
     * 查询订单项列表
     * 
     * @param shopOrderItem 订单项
     * @return 订单项
     */
    @Override
    public List<ShopOrderItem> selectShopOrderItemList(ShopOrderItem shopOrderItem)
    {
        return shopOrderItemMapper.selectShopOrderItemList(shopOrderItem);
    }

    /**
     * 新增订单项
     * 
     * @param shopOrderItem 订单项
     * @return 结果
     */
    @Override
    public int insertShopOrderItem(ShopOrderItem shopOrderItem)
    {
        return shopOrderItemMapper.insertShopOrderItem(shopOrderItem);
    }

    /**
     * 修改订单项
     * 
     * @param shopOrderItem 订单项
     * @return 结果
     */
    @Override
    public int updateShopOrderItem(ShopOrderItem shopOrderItem)
    {
        return shopOrderItemMapper.updateShopOrderItem(shopOrderItem);
    }

    /**
     * 批量删除订单项
     * 
     * @param itemIds 需要删除的订单项主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderItemByItemIds(Long[] itemIds)
    {
        return shopOrderItemMapper.deleteShopOrderItemByItemIds(itemIds);
    }

    /**
     * 删除订单项信息
     * 
     * @param itemId 订单项主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderItemByItemId(Long itemId)
    {
        return shopOrderItemMapper.deleteShopOrderItemByItemId(itemId);
    }
}
